﻿/*************************************************************************
  File:   as/preview.as
  Author: Duykham
  UpDate: 15/09/2006
  TODO:   Preview Video from Camera
/*************************************************************************/

echo("#included: as/preview_S1.as");

///////////////////////////////////////////////////////////////////////////
//TODO: include files

///////////////////////////////////////////////////////////////////////////
//TODO: Initialize

//var cameras:Array = camArray;
camList_cb.dataProvider = camArray;
trace("camArray[0].label: "+_root.camArray[0].label);

///////////////////////////////////////////////////////////////////////////
//TODO: Functions

changeCamListener.change = function (event)
{
	//TODO: Lua chon camera de Preview
	trace("changeCam.change = function (event)");
	var id:Number = Number(camList_cb.value);
	trace(camList_cb.value);
	_root.camPreview = Camera.get(id);
	//Hien thi o che do binh thuong
	preview(1,_root.camPreview);
};
camList_cb.addEventListener ("change", changeCamListener);


preview = function (PrevMode:Number, cam:Camera)
{
	//TODO: Hien thi hinh anh tu Camera
	//PrevMode: che do hien thi
	//1: Che do binh thuong
	//2: Che do don sac - tam goi la the!!!
	if(PrevMode == 1)
	{
		preview_vid.attachVideo (cam);
	}
	else if (PrevMode == 2)
	{
		//do nothing
	};
};